ci: add uv lock --check to catch stale lockfiles - #1081
Conversation
When uv.lock is regenerated with a different Python version than CI uses (e.g., local 3.13 vs CI 3.14), package resolutions can differ, leading to missing wheels at test time. Adding 'uv lock --check' before pytest catches this early with a clear error message instead of cryptic install failures.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe Python test workflow adds a ChangesDependency Validation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to The Python test matrix now detects stale dependency lockfiles before running tests. The change is ready to merge with no identified current risk. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the lockfile bright Comment |
Problem
When
uv.lockis regenerated locally with a different Python version than CI uses (e.g., local Python 3.13 via.python-versionvs CI Python 3.14), package resolutions can differ. This leads to packages like Pillow resolving to older versions that lackcp314wheels, causing CI test failures with cryptic install errors.This happened on #1068 — after a rebase,
uv lockwas run locally with Python 3.13, which resolved Pillow to 11.2.1 (no cp314 wheels) instead of 12.3.0 (has cp314 wheels), breaking the Python 3.14 CI job.Fix
Add a
uv lock --checkstep beforeRun pytestin the CI workflow. This command verifies that the lockfile is consistent with the currentpyproject.tomland Python version without modifying it. If the lockfile is stale or was generated with a different Python, the step fails early with a clear error message instead of proceeding to cryptic wheel installation failures.Notes
uv lock --checkis a read-only operation — it never modifies the lockfile.python-versionfile is already in.gitignore, so this is the safety net for developers who have local overrides